package com.demo.fieldbind.model;

import cn.hutool.core.util.RandomUtil;
import com.demo.fieldbind.BindTypeEnum;
import com.demo.fieldbind.CustomFieldBind;
import lombok.Getter;
import lombok.Setter;

/**
 * @author shenguangyang
 */
@Getter
@Setter
public class FieldBindTestReq01 {
    @CustomFieldBind(type = BindTypeEnum.USER_STATUS, target = "statusText")
    private Integer status;

    private String statusText;

    @CustomFieldBind(type = BindTypeEnum.DATA1_STATUS, target = "data1StatusText")
    private Integer data1Status;
    private String data1StatusText;

    @CustomFieldBind(type = BindTypeEnum.DATA2_STATUS, target = "data2StatusText")
    private Integer data2Status;
    private String data2StatusText;

    public FieldBindTestReq01() {
    }

    public static FieldBindTestReq01 initTest() {
        FieldBindTestReq01 fieldBindTestReq = new FieldBindTestReq01();
        int i = RandomUtil.randomInt(1, 10);
        fieldBindTestReq.status = i > 6 ? null : i;
        fieldBindTestReq.data1Status = i > 8 ? null : i;
        fieldBindTestReq.data2Status = i > 2 ? null : i;
        return fieldBindTestReq;
    }
}
